<?php

/**
 * AntecedenteFamiliar form base class.
 *
 * @method AntecedenteFamiliar getObject() Returns the current form's model object
 *
 * @package    sibi-salud
 * @subpackage form
 * @author     SIBI <sibiud@gmail.com>
 */
abstract class BaseAntecedenteFamiliarForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'cita_medica_id' => new sfWidgetFormPropelChoice(array('model' => 'CitaMedica', 'add_empty' => true)),
      'persona_id'     => new sfWidgetFormPropelChoice(array('model' => 'Persona', 'add_empty' => true)),
      'cie10_id'       => new sfWidgetFormPropelChoice(array('model' => 'Cie10', 'add_empty' => true)),
      'observaciones'  => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorPropelChoice(array('model' => 'AntecedenteFamiliar', 'column' => 'id', 'required' => false)),
      'cita_medica_id' => new sfValidatorPropelChoice(array('model' => 'CitaMedica', 'column' => 'id', 'required' => false)),
      'persona_id'     => new sfValidatorPropelChoice(array('model' => 'Persona', 'column' => 'id', 'required' => false)),
      'cie10_id'       => new sfValidatorPropelChoice(array('model' => 'Cie10', 'column' => 'id', 'required' => false)),
      'observaciones'  => new sfValidatorString(array('max_length' => 255)),
    ));

    $this->widgetSchema->setNameFormat('antecedente_familiar[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AntecedenteFamiliar';
  }


}
